<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  <link rel="icon" href="static/images/jssj11.jpg">
  <title><%= htmlWebpackPlugin.options.title %></title>
</head>

<body>
  <noscript>
    <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
      Please enable it to continue.</strong>
  </noscript>
  <div id="app" style="z-index: 2;"></div>
  <!-- <iframe style="z-index: index 999" id="iframe" class="iframe" src="./phone.html" frameborder="0" /></iframe> -->
</body>
<script>
  var show = true
  var IVRDataDemo = '';
  window.IVRData = '';
  console.log(sessionStorage.getItem('from'))
  var aaa = setInterval(login, 1000)
  var write
  let div = document.getElementById('iframe')
  console.log(div)
  // 登录定时器监听
  function login() {
    is = window.sessionStorage.getItem('from')
    if (is == 1) {
      clearInterval(aaa)
      aaa = null
      div.classList.add('iframes');
      write = setInterval(getwrite, 1000)
    } else {}
  }
  // 登出定时器监听
  function getwrite() {
    is = window.sessionStorage.getItem('from')
    if (is == 0) {
      clearInterval(write)
      div.classList.remove('iframes');
      aaa = setInterval(login, 1000)
    } else {}
  }
  // 登录时启动
  // function startOtherPlugin() {
  //     window.phoneUserInfo = phoneUserInfo;
  //     phone.defineEvent('btn_login');
  //     console.log(phone)
  // }
  // 注销时结束

  function cancelOtherPlugin() {
    var phone = window.phone;
    if (phone) {
      phone.defineEvent('btn_logout');
    }
  }
  let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
  console.log('htmlWidth', htmlWidth)
  //得到html的Dom元素
  let htmlDom = document.getElementsByTagName('html')[0];
  if (htmlWidth > 640) { //超过640大小的
    div.style.width = '1400px'
    // 宽度为640
    this.show = true
    // htmlWidth = 640;
    console.log('htmlWidth-true', htmlWidth, this.show)
  } else {
    div.style.display = 'none'
    this.show = false
    console.log(this.show)
  }
  //设置根元素字体大小
  // htmlDom.style.fontSize = htmlWidth / 40 + 'px';
</script>
<style>
  .iframe {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translate(-50%, 0%);
    z-index: 99999;
    height: 50px;
    opacity: 0;
    transition: all .3s;
  }

  .iframes {
    opacity: 1;
  }

  .iframes:hover {
    height: 300px;
    background: rgba(0, 0, 0, 0.15);
  }

  /*17601634501*/
  /* node 执行命令 node r.js -o build.js*/
</style>

</html>
